﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using PhotoGallery.Infrastructure.Modules;

namespace PhotoGallery.Modules
{
    public class AccountModule : IModule
    {

        #region Field & Property

        private readonly string[] controllerNamespaces;

        #endregion

        public AccountModule()
        {
            this.controllerNamespaces = new String[] { "PhotoGallery.Modules.Account.Controllers" };
        }

        public void Initialize()
        {

        }

        public void Unload()
        {

        }

        public void RegisterRoutes(System.Web.Routing.RouteCollection routes)
        {
            routes.MapRoute(
               "Account", // Route name
               "Account/{action}/{id}", // URL with parameters
               new { controller = "Account", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
               new { controller = "(Account)", action = "(Index|Add|Create|Edit|Update|Delete|CheckLoginName|Login|LogOut|ReLogin|EditPassword|UpdatePassword)" },
               controllerNamespaces
           );
        }

        public void RegisterModelBinders(System.Web.Mvc.ModelBinderDictionary binders)
        {

        }
    }
}
